﻿<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" href="/MobWeb/weui/css/weui.css" />
    <link rel="stylesheet" href="/MobWeb/weui/css/weuix.css" />
    <script src="/MobWeb/weui/js/zepto.min.js"></script>
    <script src="/MobWeb/weui/js/zepto.weui.js"></script>
    <script src="/ViewV5/JS/vue.js"></script>
    <script src="/MobWeb/JS/ComFunJS.js"></script>
</head>
<body ontouchstart>
    <div class="page-hd">
        <h1 class="page-hd-title">
            修改密码
        </h1>
        <p class="page-hd-desc"></p>
    </div>
    <div class="weui-cells__title">修改密码</div>
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">新密码</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" placeholder="请输入新密码" type="password" id="mm1">
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">新密码</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" placeholder="请再次输入新密码" type="password"  id="mm2">
            </div>
        </div>

    </div>
    <div class="weui-cells__tips">修改密码后请重新登录</div>

    <div class="weui-btn-area">
        <a class="weui-btn weui-btn_primary" href="javascript:" id="btn">确定修改</a>
    </div>

    <br>
    <br>
    <div class="weui-footer weui-footer_fixed-bottom">
        <p class="weui-footer__links">
            <a href="#" class="weui-footer__link"></a>
        </p>
        <p class="weui-footer__text">Copyright &copy; 企捷科技</p>
    </div>
    <script>
        $(function () {
            $(document).on("click", "#btn", function () {
                if (!$("#mm1").val() || !$("#mm2").val()) {
                    alert('不能为空');
                }
                var up = ComFunJS.getCookie("up");
                $.getJSON("/api/Auth/ExeAction?Action=MODIFYPWD", { P1: $("#mm1").val(), P2: $("#mm2").val(), username: ComFunJS.getCookie('username') }, function (r) {
                    if (!r.ErrorMsg) {
                        alert('修改成功,请重新登录!')
                    } else {
                        alert(r.ErrorMsg);
                    }

                })
            })
            //解决表单控件不能回弹 只有微信ios有这个问题
            $("input,select,textarea").blur(function () {
                setTimeout(() => {
                    const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
                    window.scrollTo(0, Math.max(scrollHeight - 1, 0));
                }, 100);
            })

        });
    </script>
</body>
</html>